import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../views/Login/index.vue";
import Register from "../views/Register/index.vue";
import Home from "../views/index/Home.vue";
import OneWord from "../views/index/oneWord/OneWord.vue";
import DataShare from "../views/index/dataShare/DataShare.vue";
import Information from "../views/index/personal/Information.vue"
import Manger from "../views/manger/index.vue"
import UserManger from "../views/manger/usermanger.vue"
import FileManger from "../views/manger/filemanger.vue"
import Exit from "../views/manger/edit.vue"
import UploadFile from "../views/index/personal/uploadfile.vue"
Vue.use(VueRouter);
const routes = [
  {
    path: "/",
    redirect: "login",
  },
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/register",
    name: "Register",
    component: Register,
  },
  {
    path: "/home",
    name: "Home",
    component: Home,
    children: [
      {
        path: "/home/oneWord",
        name: "OneWord",
        component: OneWord,
      },
      {
        path: "/home/dataShare",
        name: "DataShare",
        component: DataShare,
      },
      {
        path: "/home/Information",
        name: "Information",
        component: Information,
      },
    ],
  },
  {
    path: "/manger",
    name: "Manger",
    component: Manger,
    children: [{
      path: "/manger/usermanger",
      name: "UserManger",
      component: UserManger
    },
    {
      path: "/manger/filemanger",
      name: "FileManger",
      component: FileManger
    },
    {
      path: "/manger/edit",
      name: "Edit",
      component: Exit
    }]
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
